package edu.ynu.se.xiecheng.achitectureclass.nongye.entity;

import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

@Getter
@Setter
@Entity
@Table(name = "water")
public class Water extends LogicEntity {

    @Column(name = "device_id", nullable = false, length = 20)
    private String deviceId;  // 外键，关联设备

    @Column(name = "name", nullable = false, length = 50)
    private String name;  // 水质名称

    @Column(name = "value", nullable = false)
    private Float value;  // 水质参数值

    @Column(name = "time", nullable = true)
    private Date time;  // 时间，默认为当前时间
}
